﻿using Communication;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Clipper.ClipperUserControl
{
    /// <summary>
    /// UserFastToPosition.xaml 的交互逻辑
    /// </summary>
    public partial class UserFastToPosition : UserControl
    {
        public UserFastToPosition()
        {
            InitializeComponent();
        }

        private void Grid_Loaded(object sender, RoutedEventArgs e)
        {
            comboBox.Items.Clear();
            comboBox1.Items.Clear();
            comboBox2.Items.Clear();
            comboBox3.Items.Clear();
            comboBox4.Items.Clear();

            for (int i = 0; i < 75; i++)
            {
                comboBox.Items.Add((i + 1).ToString());
            }
            for (int i = 0; i < 6; i++)
            {
                comboBox1.Items.Add((i + 1).ToString());
                comboBox3.Items.Add((i + 1).ToString());
            }
            for (int i = 0; i < 30; i++)
            {
                comboBox2.Items.Add((i + 1).ToString());
            }
            for (int i = 0; i < 16; i++)
            {
                comboBox4.Items.Add((i + 1).ToString());
            }

        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            //传递样品的位置去定点
            ArmMoveControl.PositionToSampleEnginner(Convert.ToInt32(comboBox.SelectedValue));
        }

        private void button7_Click(object sender, RoutedEventArgs e)
        {
            // Z2冷试剂区定位
            ArmMoveControl.Z2ColdReagentToPositionEnginner(Convert.ToInt32(comboBox2.SelectedValue));
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            // Z1冷试剂定位到的地点 
            ArmMoveControl.Z1ColdReagentToPositionEnginner(Convert.ToInt32(comboBox2.SelectedValue));
        }

        private void button4_Click(object sender, RoutedEventArgs e)
        {
            //Z1检测区定位
            ArmMoveControl.Z1DetectAreaToPositionEnginner(Convert.ToInt32(comboBox4.SelectedValue));
        }

        private void button5_Click(object sender, RoutedEventArgs e)
        {
            //Z2检测区定位
            ArmMoveControl.Z2DetectAreaToPositionEnginner(Convert.ToInt32(comboBox4.SelectedValue));
        }

        private void button3_Click(object sender, RoutedEventArgs e)
        {
            //常温Z1的试剂定位
            ArmMoveControl.Z1OrdinaryReagentToPositionEnginner(Convert.ToInt32(comboBox3.SelectedValue));
        }

        private void button6_Click(object sender, RoutedEventArgs e)
        {
            //常温Z2的试剂定位
            ArmMoveControl.Z2OrdinaryReagentToPositionEnginner(Convert.ToInt32(comboBox3.SelectedValue));
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            //紧急样本区的定位
            ArmMoveControl.urgentSampleToPositionEnginner(Convert.ToInt32(comboBox1.SelectedValue));
        }
    }
}
